package com.wiscamp.ninechapters.problems.enums;

/**
 * 难度级别枚举
 */
public enum DifficultyLevels {
    VERY_EASY(20, "Very Easy"),
    EASY(40, "Easy"),
    NORMAL(60, "Normal"),
    HARD(80, "Hard"),
    VERY_HARD(100, "Very Hard"),
    EXTREMELY_HARD(120, "Extremely Hard");

    private final int value;

    private final String name;

    DifficultyLevels(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static DifficultyLevels valueOf(int value) {
        return switch (value) {
            case 20 -> DifficultyLevels.VERY_EASY;
            case 40 -> DifficultyLevels.EASY;
            case 60 -> DifficultyLevels.NORMAL;
            case 80 -> DifficultyLevels.HARD;
            case 100 -> DifficultyLevels.VERY_HARD;
            case 120 -> DifficultyLevels.EXTREMELY_HARD;
            default -> null;
        };
    }
}
